<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path= request.getContextPath();
	System.out.print(path);
	String basePath = request.getScheme() + "://"    + request.getServerName() + ":" + request.getServerPort()    + path + "/";
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="<%=path %>/pages/admin/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/pages/admin/easyui/themes/icon.css">
<script type="text/javascript" src="<%=path %>/pages/admin/easyui/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/pages/admin/easyui/jquery.easyui.min.js"></script>
<script>
$(function(){
			$('#test').datagrid({
				title:'My DataGrid',
				iconCls:'icon-save',
				width:700,
				height:350,
				nowrap: true,
				autoRowHeight: false,
				striped: true,
				collapsible:true,
				sortName: 'code',
				sortOrder: 'desc',
				remoteSort: false,
				pagination:true
			});
			var p = $('#test').datagrid('getPager');
			
			$(p).pagination({
				onBeforeRefresh:function(){
					alert('before refresh');
				},
				total:'<s:property value="page.totalNum" />' 				
			});
		});
</script>
</head>
<body>
<s:a namespace="/pages/admin" action="%{actionName}" method="form">新建</s:a>
<s:form action="%{actionName}!search" namespace="/pages/admin" method="post">
            
            <s:password label="密码" name=""></s:password>
            <s:token></s:token>
            <s:submit value="查询"></s:submit>
</s:form>
<table class="easyui-datagrid" id="test"> 
	<thead>  
	     <tr> 
	        <th data-options="field:'ck'"></th> 
	        <th data-options="field:'code'">序号</th>  
	        <th data-options="field:'name'">代码值</th>  
	        <th data-options="field:'username'">代码内容</th>  
	        <th data-options="field:'password'">代码类型</th>  
	        <th data-options="field:'price'">操作</th>  
	      </tr>  
	</thead>
	<tbody>
	<s:iterator value="page.list" status="rowstatus">
		<tr>
			<td><s:checkbox name="ck"></s:checkbox></td>
			<td><s:property
					value="#rowstatus.index+1+page.pageNum*page.pageSize" /></td>
			<td><s:property value="key" /></td>
			<td><s:property value="value" /></td>
			<td><s:property value="type" /></td>
			<td><s:a namespace="/pages/admin" method="form"
					action="%{actionName}">
					<s:param name="id" value="%{id}"></s:param>
			修改</s:a>|
			<s:a namespace="/pages/admin" method="delete"
					action="%{actionName}" onclick="return confirm('确定要删除?')">
					<s:param name="id" value="%{id}"></s:param>
			删除</s:a></td>
		</tr>
	</s:iterator>
	</tbody>
</table>
</body>
</html>